import java.math.*;
public class Chemical 
{
	private String chemicalName;
	private double chemicalConc;
	private double volume;
	private double molecularWeight;
	private BigDecimal decimalAmount;
	private double TextFieldTestGeneCtValue1;
	private double TextFieldControlgeneCtValue1;
	private double TextFieldTestGeneCtValue2;
	private double TextFieldControlgeneCtValue2;
	private BigDecimal decimalfolderChange;
	private String Sample1Name;
	private String Sample2Name;

	
	public Chemical ()
	{
		chemicalName = "";
		chemicalConc = 0.0;
		volume = 0.0;
		molecularWeight = 0; 
		TextFieldTestGeneCtValue1 = 0.0;
		TextFieldControlgeneCtValue1 = 0.0;
		TextFieldTestGeneCtValue2 = 0.0;
		TextFieldControlgeneCtValue2 = 0.0;
		Sample1Name = "";
		Sample2Name = "";
		
	}
	public Chemical (String chemicalName, double chemicalConc, double volume, double molecularWeight )
	{
		this.chemicalName = chemicalName;
		this.chemicalConc = chemicalConc;
		this.volume = volume;
		this.molecularWeight = molecularWeight;
		double amount = chemicalConc * volume * molecularWeight / 1000;
		// format the result with 2 decimal
		BigDecimal decimalAmount = new BigDecimal (Double.toString(amount));  //wrap it as double, change to string
		decimalAmount = decimalAmount.setScale(2, RoundingMode.HALF_UP);
		this.decimalAmount = decimalAmount;
		
	}
	public Chemical (String Sample1Name, String Sample2Name, double TextFieldTestGeneCtValue1, double TextFieldControlgeneCtValue1, double TextFieldTestGeneCtValue2, double TextFieldControlgeneCtValue2)
	{
		this.Sample1Name = Sample1Name;
		this.Sample2Name = Sample2Name;
		this.TextFieldTestGeneCtValue1 = TextFieldTestGeneCtValue1;
		this.TextFieldTestGeneCtValue2 = TextFieldTestGeneCtValue2;
		this.TextFieldControlgeneCtValue1 = TextFieldControlgeneCtValue1;
		this.TextFieldControlgeneCtValue2 = TextFieldControlgeneCtValue2;
		double delta = (TextFieldTestGeneCtValue2-TextFieldControlgeneCtValue2) - (TextFieldTestGeneCtValue1-TextFieldControlgeneCtValue1);
		double folderChange = Math.pow (2, delta);
		BigDecimal decimalfolderChange = new BigDecimal (Double.toString(folderChange));  //wrap it as double, change to string
		decimalfolderChange = decimalfolderChange.setScale(2, RoundingMode.HALF_UP);
		this.decimalfolderChange = decimalfolderChange;
	}
	

	public String getChemicalName (Chemical c)
	{
		return chemicalName;
	}
	public double getChemicalConc (Chemical c)
	{
		return chemicalConc;
	}
	public double getVolume (Chemical c)
	{
		return volume;
	}
	public double getMolecularWeight (Chemical c)
	{
		return molecularWeight;
	}
	public BigDecimal getDecimalAmount (Chemical c)
	{
		return decimalAmount;
	}
	public BigDecimal getdecimalfolderChange ()
	{
		return decimalfolderChange;
	}
	public String getSample1Name ()
	{
		return Sample1Name;
	}
	public String getSample2Name ()
	{
		return Sample2Name;
	}
}